package com.fqy.thread.lambda;

/**
 * User: fqy
 * Date: 2021/8/31
 * Time: 13:39
 * Describe:
 */
public class LambdaExpress {
    public static void main(String[] args) {
        //方式一
        Foo foo = new Foo() {
            @Override
            public void sayHello() {
                System.out.println("Hello Lambda!!!");
            }
        };
        foo.sayHello();
        //方式二
        Foo foo1 = () -> {
            System.out.println("你好LambdaExpress");
        };
        foo1.sayHello();

        Mathtic mathtic = (a,b) ->{
            System.out.println(a+b);
        };

        mathtic.add(10, 20);
        int dev = mathtic.dev(20, 10);
        System.out.println(dev);
    }
}
